package com.ruoyi.admin.domain;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 传感器数据对象 sensor
 *
 * @author ruoyi
 * @date 2025-03-14
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Sensor extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键，自增，唯一标识每一条记录
     */
    private Long id;

    /**
     * 传感器名字
     */
    @Excel(name = "传感器名字")
    private String name;

    /**
     * 温度，单位：摄氏度
     */
    @Excel(name = "温度，单位：摄氏度")
    private Long temperature;

    /**
     * 湿度，单位：百分比
     */
    @Excel(name = "湿度，单位：百分比")
    private Long humidity;

    /**
     * 土壤氮含量，单位：ppm
     */
    @Excel(name = "土壤氮含量，单位：ppm")
    private Long soilN;

    /**
     * 土壤磷含量，单位：ppm
     */
    @Excel(name = "土壤磷含量，单位：ppm")
    private Long soilP;

    /**
     * 土壤钾含量，单位：ppm
     */
    @Excel(name = "土壤钾含量，单位：ppm")
    private Long soilK;

    /**
     * 时间戳
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "时间戳", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date timestamp;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "时间戳", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "时间戳", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;


    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setTemperature(Long temperature) {
        this.temperature = temperature;
    }

    public Long getTemperature() {
        return temperature;
    }

    public void setHumidity(Long humidity) {
        this.humidity = humidity;
    }

    public Long getHumidity() {
        return humidity;
    }

    public void setSoilN(Long soilN) {
        this.soilN = soilN;
    }

    public Long getSoilN() {
        return soilN;
    }

    public void setSoilP(Long soilP) {
        this.soilP = soilP;
    }

    public Long getSoilP() {
        return soilP;
    }

    public void setSoilK(Long soilK) {
        this.soilK = soilK;
    }

    public Long getSoilK() {
        return soilK;
    }

    public void setTimestamp(Date timestamp) {
        this.timestamp = timestamp;
    }

    public Date getTimestamp() {
        return timestamp;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("name", getName())
                .append("temperature", getTemperature())
                .append("humidity", getHumidity())
                .append("soilN", getSoilN())
                .append("soilP", getSoilP())
                .append("soilK", getSoilK())
                .append("timestamp", getTimestamp())
                .toString();
    }
}
